import base;
import win32api;
import win32con;
from ctypes import windll;
import time;

class input(base.input):
	def __init__(self):
		self.etbl = (
			win32con.MOUSEEVENTF_LEFTDOWN,
			win32con.MOUSEEVENTF_LEFTUP,
			win32con.MOUSEEVENTF_MIDDLEDOWN,
			win32con.MOUSEEVENTF_MIDDLEUP,
			win32con.MOUSEEVENTF_RIGHTDOWN,
			win32con.MOUSEEVENTF_RIGHTUP
		);
	def warp(self,x,y):
		windll.user32.SetCursorPos(x,y);
	def press(self,button):
		win32api.mouse_event(self.etbl[2*button],0,0,0);
	def release(self,button):
		win32api.mouse_event(self.etbl[1+2*button],0,0,0);
	def click(self,button):
		self.press(button);
		time.sleep(0.05);
		self.release(button);

class output(base.output):
	def __init__(self):
		pass;
	def resolution(self):
		return (win32api.GetSystemMetrics(0),win32api.GetSystemMetrics(1));
